@layout("/common/_container.html"){
<style>.selecteds{width:50%;height:39px;padding-left:10px;}.divBox > div{margin-bottom:20px;}ul{margin:0;padding:0;}input{border:1px solid #a9a9a9;border-radius:3px;}.ul_li > li{float:left;margin-right:3%;margin-bottom:15px;}.ul_li label{padding-right:9px;}.records > li{color:white;cursor:pointer;float:left;margin-right:3%;}.btn_box button{margin:0;color:white;background:#2b6594;padding:6px 30px;font-size:1em;}.records > li > span{font-weight:bolder;}</style>
<div class="ibox-content">
    <div style="display: none">
        <input type="hidden" id="reservationsId" value="${reservationsId}">
        <input type="hidden" id="customerId" value="${customerId}">
    </div>
    <div class="clearfix divBox">
        <div class="col-sm-12">
            <div class="col-sm-4" style="text-align: right"><span>预约回访人</span></div>
            <div class="col-sm-8"><input type="text" class="selecteds" id="doctor" value="${doctor}"
                                         disabled="disabled"></div>
        </div>
        <div class="col-sm-12">
            <div class="col-sm-4" style="text-align: right"><span>预约回访时间</span></div>
            <div class="col-sm-8"><input type="text" id="revisitTime" autocomplete="off" class="selecteds"
                                         onclick="laydate({istiem:true,format:'YYYY-MM-DD'})"></div>
        </div>
        <div class="col-sm-12">
            <div class="col-sm-4" style="text-align: right"><span>备注</span></div>
            <div class="col-sm-8"><textarea style="height: 100px;" name="remarks" id="remarks"
                                            class="selecteds"></textarea></div>
        </div>
        <div class="btn_box col-sm-12">
            <div class="col-sm-4"></div>
            <div class="col-sm-8">
                <button type="button" class="btn" id="submit">提交</button>
                <button type="button" class="btn" onclick="cancel()">取消</button>
            </div>
        </div>
    </div>
</div>
<script>
    var windowNameIndex = parent.layer.getFrameIndex(window.name); //获取窗口索引
    submit.onclick = function () {
        var doctor = document.getElementById("doctor").value;   //医生
        var revisitTime = document.getElementById("revisitTime").value;  //预约时间
        var remarks = document.getElementById("remarks").value;   //备注
        var customerId = document.getElementById("customerId").value;   //客户id
        var reservationsId = document.getElementById("reservationsId").value;   //预约id
        if (revisitTime == "" || revisitTime == null) {
            alert("请选择预约回访时间！");
            return;
        }
        if (remarks == "" || remarks == null) {
            alert("请输入备注！");
            return;
        }
        $.ajax({
            url: Feng.ctxPath + "/doctorLooked/addDoctorContent",
            type: "post",
            data: {
                doctor: doctor,
                revisitTime: revisitTime,
                remarks: remarks,
                customerId: customerId,
                reservationsId: reservationsId
            },
            success: function (data) {
                Feng.success('操作成功!');
                parent.layer.close(windowNameIndex);
            },
            error: function (data) {
                alert('没有权限，请联系管理员!');
            }
        });
    };

    function cancel() {
        parent.layer.close(windowNameIndex);
    }
</script>
@}